package pub.guoxin.server.simulation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import pub.guoxin.server.simulation.service.SimulationService;

/**
 * Create by guoxin on 2018/5/12
 */
@SpringBootApplication
public class SimulationApplication implements CommandLineRunner {

    @Autowired
    private SimulationService simulationService;

    public static void main(String[] args) {
        SpringApplication.run(SimulationApplication.class, args);
    }

    @Override
    public void run(String... strings) {
        while (true) {
            simulationService.simulation();
            // 时间间隔1分钟
            try {
                Thread.sleep(1000 * 60);
            } catch (InterruptedException ignored) {
            }
        }
    }
}
